<!DOCTYPE html>
<html class="um-win">
	<head>
		<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="./css/font-icons.css">
		<link rel="stylesheet" href="./css/iuapmobile.um.css">
		<link rel="stylesheet" href="./css/bootstrap.min.css">
		<script src="./js/jquery.min.js" ></script>
		<script src="./js/summer.js" ></script>
		<script src="./js/Frameworks/iuapmobile.frameworks.ui.js" ></script>
		<script src="./js/k/kconfig.js" ></script>
		<script src="./js/k/kpublic.js" ></script>
		<script src="./js/bootstrap.min.js" ></script>
		<script src="./js/PushMsgUtils.js" ></script>
		<script src="./js/login.js" ></script>
		<style>
			.um-content {
				background: #256FEA;
			}
			.login {
				background: #fff;
				padding: 15px;
				border-radius: 5px;
				padding: 6%;
			}
			.login button.um-btn {
				border-radius: 3px;
				padding: 5px 12px;
				border-color: #009BF5;
				background: #009BF5;
			}
			.login p.title {
				color: #00B3ED;
			}
			.login p.user {
				color: #848484;
			}
			input.form-control {
				border: none;
				border-bottom: 1px solid #e3e3e5;
				padding-left: 0px;
			}
			input.form-control:focus {
				box-shadow: none;
			}
			.login .um-input-clear {
				color: #fff;
				background-color: #ddd;
				padding: 4px;
			}
			.form-control:focus + .um-input-clear {
				color: #fff;
			}
			.um-input-clear.ti-eye.eye {
				color: #256FEA;
			}
		</style>
	</head>
	<body>
		<div class="modal fade" id="loadingmodel" tabindex="-1" role="dialog" aria-hidden="true"
		style="position: fixed;top: 45%; margin: auto;text-align: center">
			<div style="width:45%; border-radius: 6px;background: rgba(119, 119, 119, 0.5);
			position: relative;top:40%; margin: auto;">
				<div class="modal-header" >
					<img src="img/loading.gif" style="width: 30px">
					<span><b>请稍后...</b></span>
				</div>
			</div>
		</div>

		<div class="um-page um-win" id="index">
			<div id="main" class="um-content p15 um-box-center um-row">
				<div class="login um-xs-10 um-sm-6 um-md-4 um-lg-3">
					<p class="title tc mb30 fb f24">
						一点生活
					</p>
					<p class="user f14">
						手机号
					</p>
					<div class="pr">
						<input id = "tel" type="text" class="form-control um-no-brs" value = '15688868544' placeholder="请输入手机号">
						<span class="um-input-clear ti-close um-circle  f12"></span>
					</div>
					<p class="user f14 mt10">
						密码
					</p>
					<div class="pr">
						<input id = "password" type="password" class="form-control um-no-brs"  value = '123456' placeholder="请输入密码">
						<span class="um-input-clear ti-eye um-circle  f12 "></span>
					</div>
					<button id = "dologin" class="um-btn mt30">
						登  录
					</button>
					<!-- <p class="tr mt10 f12"><a href="">忘记密码？</a></p> -->
					
                    <!-- <button class="btn" id = 'startjpush'>startjpush</button> -->

				</div>
			</div>
		</div>
		<script>
			$(function() {
				$(".um-input-clear.ti-close").click(function() {
					$(this).prev("input").val("");
				})
				$(".um-input-clear.ti-eye").click(function() {
					var $pre_input = $(this).prev("input");
					('password' == $pre_input.attr('type')) ? $pre_input.attr('type', 'text') : $pre_input.attr('type', 'password');
					$(this).toggleClass('eye');
				})
			})
			
			/*					被注释掉的是iuap3.1中的套路
					//alert("我点击了登陆");
					var username = $("#username").val();
					var password = $("#password").val();
					var dengluData = {
						kParam : []
					};
					var data = {
						"username" : username,
						"password" : password,
					};
					dengluData.kParam.push(data);
					
					//alert(JSON.stringify(dengluData));
					//alert(baseUrl + loginurl);
					
					$.ajax({
						type : "POST",
						url : baseUrl + loginurl,
						timeout : 20000, //超时时间设置，单位毫秒
						data : JSON.stringify(dengluData),
						contentType:"text/plain",
						dataType : "json",
						success : function(args) {
							$('#loadingmodel').modal('hide');
							var sResultData = args.resultData;
							var sResultMsg = args.resultMsg;
							var sResultCode = args.resultCode;
							//alert(sResultCode);
							if (sResultCode == 0 || sResultCode == 30) {//成功(0为业主用户;30为非业主用户，缓存中没有user_id)
								//alert(sResultData);
								var jResultData = eval(sResultData);
								var owner_id = jResultData[0].owner_id;
								var name = jResultData[0].name;
								var user_id = jResultData[0].user_id;
								//alert(owner_id);
								//alert(document.cookie);
								saveInfo("owner_id", owner_id);
								saveInfo("user_id",user_id);
								saveInfo("name", name);
								summer.openWin({
									"id" : 'index',
									"url" : 'index.html'
								});
							} else if (sResultCode == 10 || sResultCode == 20) {
								UM.alert({
									title : '提示内容',
									text : sResultMsg,
									btnText : ["", "确定"],
								});
							} 
						},
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							if (textStatus == 'timeout') {
								$('#loadingmodel').modal('hide');
								$('#loadingmodel').on('hidden.bs.modal', function() {
									summer.toast({
										"msg" : "网络连接不可用，请稍后重试"
									});
								});
							}
						}
					});
*/		
		</script>
	</body>
</html>


